//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Mesa.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)
Mesa::Mesa(float alT, float lT, float anT, float gT, float rP){
        alturaTablero=alT;
        largoTablero=lT;
        anchoTablero=anT;
        grosorTablero=gT;
        radioPata=rP;

        traslada(0,alturaTablero,0);

        Tablero *tablero=new Tablero(largoTablero,anchoTablero, grosorTablero, 5, 4, 3);
        anadeParte(tablero);
        tablero->setColor(1.0,0.0,0.0);

        Cilindro* pata1=new Cilindro(radioPata,radioPata/2, alturaTablero,10,5);
        anadeParte(pata1);
        pata1->setColor(0.6,0.2,0.0);
        pata1->traslada(largoTablero - radioPata,0,radioPata);
        pata1->rota(90,1,0,0);

        Cilindro* pata2=new Cilindro(radioPata,radioPata/2, alturaTablero,10,5);
        anadeParte(pata2);
        pata2->setColor(0.6,0.2,0.0);
        pata2->traslada(radioPata,0,radioPata);
        pata2->rota(90,1,0,0);

        Cilindro* pata3=new Cilindro(radioPata,radioPata/2, alturaTablero,10,5);
        anadeParte(pata3);
        pata3->setColor(0.6,0.2,0.0);
        pata3->traslada(radioPata,0,anchoTablero - radioPata);
        pata3->rota(90,1,0,0);

        Cilindro* pata4=new Cilindro(radioPata,radioPata/2, alturaTablero,10,5);
        anadeParte(pata4);
        pata4->setColor(0.6,0.2,0.0);
        pata4->traslada(largoTablero - radioPata,0,anchoTablero - radioPata);
        pata4->rota(90,1,0,0);
}


